<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>{$title}</title>
<link href="__PUBLIC__/css/admin.css" rel="stylesheet" type="text/css">
<style>
.searchcontent{ margin-left:246px; height:auto; overflow:hidden; width:980px; padding-bottom:15px;}
.searchcontent .search{ width:100%; height:auto; overflow:hidden;}
.searchcontent .search p{ font-size:18px; line-height:40px; color:#777777;}
.searchcontent .search p span{ color:#FB0105;}
.searchcontent .search p a.xz{ cursor:pointer;}
.searchcontent .search .nr{ width:100%; height:auto; overflow:hidden; margin-bottom:30px;}
.searchcontent .search .nr1{ width:100%; height:auto; overflow:hidden; margin-bottom:30px;}
.searchcontent .search .nr1 p input{font-size:18px; line-height:40px; color:#777777; width:450px;}
.searchcontent .search .nr1 p a.wz input{ display:block; color:#0089e1; cursor:pointer;}
.current{ color:#0089e1; cursor:pointer; border:1px solid #0089e1; padding:0 8px; margin-right:5px;}
.next{ color:#777777; text-decoration:none;}
.prev{color:#777777; text-decoration:none;}
.num{ color:#777777; text-decoration:none; cursor:pointer; border:1px solid #777777; padding:0 8px; margin-right:5px;}
.num:hover{ color:#0089e1;}
.xz{ display:none; color:#0089e1;}
.button{background: #43a1da none repeat scroll 0 0;border: 1px solid #4ba6db; border-radius: 5px;color: #fff;cursor: pointer; height: 30px; margin: 5px 5px 5px 0; width: 100px; display:none;}
</style>
</head>

<body>
<div class="head">
	<a href="/"><img src="__PUBLIC__/images/kg.jpg" class="fl"/></a>
    <form method="post" class="fl" action="__MODULE__/Indexsearch/index">
    	<input name="search" type="text" class="search fl" placeholder="请输入你想要搜索的信息">
        <input type="submit" name="submit" value="智搜一下" class="submit">
    </form>
    <p class="fr"><span>姓名</span> <a href="/" class="close">退出</a></p>
</div>
<div class="bmss">
	<div class="bmss1">
    	<p><a href="#">疾病百科</a><a href="#">咨询智库</a><a href="#">竞价智库</a><a href="#">策划智库</a></p>
    </div>
</div>
<div class="searchcontent">
	<div class="search">
    	<p>康冠智搜为您找到相关结果约<span>{$count}</span>个</p>
        <volist id="vo" name="list">
            <div class="nr">
                <p><input value="{$vo.title}" type="text" readonly name="title"/> <a target="_blank" class="xz">编辑</a> 更新时间：<span>{$vo.addtime}</span></p>
                <p><textarea  readonly name="content">{$vo.content}</textarea></p>
                <p>原作者是<span>{$vo.name}</span>，修改人是<span>{$vo.updatename}</span></p>
                <input type="button" name="sumit" value="提交" class="button"/>
                <input type="hidden" value="{$vo.id}"/>
            </div>
            <div class="nr1">
                <p><input value="{$vo.keyname}" type="text" readonly name="keyname"/> <a target="_blank" class="xz">编辑</a> 更新时间：<span>{$vo.addtime}</span></p>
                <p>创意标题：</p>
                <p><input value="{$vo.cytitle}" type="text" readonly name="cytitle"/></p>
                <p>创意描述1：</p>
                <p><input value="{$vo.cyms1}" type="text" readonly name="cyms1"/></p>
                <p>创意描述2：</p>
                <p><input value="{$vo.cyms2}" type="text" readonly name="cyms2"/></p>
                <p>相关着陆页：</p>
                <p>PC网址：<a target="_blank" class="wz"><input value="{$vo.pchttp1}" type="text" readonly name="pchttp1"/></a><a target="_blank" class="wz"><input value="{$vo.pchttp2}" type="text" readonly name="pchttp2"/></a><a target="_blank"  class="wz"><input value="{$vo.pchttp3}" type="text" readonly name="pchttp3"/></a></p>
                <p>移动网址：<a target="_blank"class="wz"><input value="{$vo.sjhttp1}" type="text" readonly name="sjhttp1"/></a><a target="_blank"  class="wz"><input value="{$vo.sjhttp2}" type="text" readonly name="sjhttp2"/></a><a target="_blank" class="wz"><input value="{$vo.sjhttp3}" type="text" readonly name="sjhttp3"/></a></p>
                <p>原作者是<span>{$vo.name}</span>，修改人是<span>{$vo.updatename}</span></p>
                <input type="button" name="sumit" value="提交"  class="button"/>
                <input type="hidden" value="{$vo.id}" name="id"/>
            </div>
        </volist>
    </div>
    {$page}
</div>
</body>
</html>
<script type="text/javascript" src="__PUBLIC__/js/jquery/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery/jquery.cookie.js"></script>
<script>
$(function(){
	var name =	$.cookie('name');
	var km = $.cookie('km');
	$(".head p span").html(name);
	$(".close").click(function(){
		$.cookie('name', '', { expires: -1 }); 
	});
	if(name){
		$(".xz").show();
	}
	if(km=="竞价智库"){
		$(".nr1").show();
		$(".nr").hide();	
	}else if(km=="咨询智库"){
		$(".nr").show();
		$(".nr1").hide();	
	}
	$(".xz").click(function(){
		$(this).parent().parent().find(".button").show(500);
		$(this).parent().parent().find("input").removeAttr("readonly");
		$(".button").click(function(){
			var keyname=$(this).parent().find("input:[name='keyname']").val();
			var cytitle=$(this).parent().find("input:[name='cytitle']").val();
			var cyms1=$(this).parent().find("input:[name='cyms1']").val();
			var cyms2=$(this).parent().find("input:[name='cyms2']").val();
			var pchttp1=$(this).parent().find("input:[name='pchttp1']").val();
			var pchttp2=$(this).parent().find("input:[name='pchttp2']").val();
			var pchttp3=$(this).parent().find("input:[name='pchttp3']").val();
			var sjhttp1=$(this).parent().find("input:[name='sjhttp1']").val();
			var sjhttp2=$(this).parent().find("input:[name='sjhttp2']").val();
			var sjhttp3=$(this).parent().find("input:[name='sjhttp3']").val();
			var id=$(this).parent().find("input:[name='id']").val();
			var title=$(this).parent().find("input:[name='title']").val();
			var content=$(this).parent().find("textarea:[name='content']").val();
			if(km=="竞价智库"){
				$.ajax({
					type:'POST',
					url:"__URL__/update",
					data:{keyname:keyname,cytitle:cytitle,cyms1:cyms1,cyms2:cyms2,pchttp1:pchttp1,pchttp2:pchttp2,pchttp3:pchttp3,sjhttp1:sjhttp1,sjhttp2:sjhttp2,sjhttp3:sjhttp3,id:id},
					success: function(){
						top.location.reload();
					}
				});	
			}else if(km=="咨询智库"){
				$.ajax({
					type:'POST',
					url:"__URL__/update",
					data:{title:title,content:content,id:id},
					success: function(){
						top.location.reload();
					}
				});	
			}
		});
	});
	$(".bmss1 p a").click(function(){
		$(".bmss1 p a").removeClass("active");
		$(this).addClass("active");
		var km=$(".bmss1 p a.active").html();
		$.cookie('km',km);
	});
})
</script>